home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-06-28 | 1.4 KB | 52 lines | [TEXT/CWIE] |
- // ListOf.h
-
- #ifndef ListOf_h
- #define ListOf_h
-
- #ifndef ListLink_h
- #include "ListLink.h"
- #endif
- #ifndef List_h
- #include "List.h"
- #endif
- #ifndef ListLoop_h
- #include "ListLoop.h"
- #endif
-
- template < class Target >
- class ListOf: private List
- {
- typedef ListLink< Target > Link;
- typedef ListLoop< Target > Loop;
-
- friend class ListLink< Target >;
- friend class ListLoop< Target >;
-
- private:
- static const ListLink<Target> *DownCast( const ListNode *n );
- static ListLink<Target> *DownCast( ListNode *n );
-
- public:
- const Link *First() const { return DownCast( List::First() ); }
- const Link *Last() const { return DownCast( List::Last() ); }
-
- Link *First() { return DownCast( List::First() ); }
- Link *Last() { return DownCast( List::Last() ); }
-
- List::IsEmpty;
-
- void Add( Link& n, BeforeStart ) { List::Add( n, beforeStart ); }
- void Add( Link& n, AfterEnd ) { List::Add( n, afterEnd ); }
-
- void Add( Link& n, Before, const Link& position ) { List::Add( n, before, position ); }
- void Add( Link& n, After, const Link& position ) { List::Add( n, after, position ); }
-
- void Add( Link& n, Before, const Loop& position ) { List::Add( n, before, position ); }
- void Add( Link& n, After, const Loop& position ) { List::Add( n, after, position ); }
-
- void Remove( Link& n ) { List::Remove( n ); }
- List::RemoveAll;
- };
-
- #endif
-